<template>
	<view>
		<cu-custom bgColor="bg-red" :isBack="true">		<block slot="backText"></block>
			<block slot="content">我的直播</block>
		</cu-custom>

		<view class="bg-white overflow">
			<view v-if="!live" class="margin-xl text-center">暂无权限</view>
			<view v-else>
				<block v-for="(live, i) in list" :key="i">
					<LiveView :value="live" :styles="'list3'"></LiveView>
				</block>
				<view class="cu-load margin-center" :class="loading?'loading':'over'"></view>
			</view>
		</view>

	</view>
</template>

<script>
	import LiveView from '@/components/shop/LiveView.vue'
	export default {
		components: {
			LiveView
		},
		data() {
			return {
				theme: this.$config.THEME(),
				list: [],
				hasMore: true,
				loading: false,
				page: 1,
			}
		},
		onLoad(options) {
			if (this.$common.loginAuth(true)) {
				this.getList()
			}
		},
		methods: {
			getList() {
				if (!this.hasMore || this.loading) return
				this.loading = true
				this.$http
					.get('marketing_auction_index', {
						my: 1,
						page: this.page,
					})
					.then((response) => {
						let list = this.list
						if (response.data.data.length > 0) {
							list = list.concat(response.data.data)
						} else {
							this.hasMore = false
						}
						this.loading = false
						this.list = list
						this.page += 1
					})
					.catch((response) => {
						console.log(response)
					})
			},
		},
	}
</script>

<style>
</style>
